LINK_ADDR
Section: C Library Functions (3)
Index
Return to Main Contents
BSD mandoc
BSD 4.4
NAME
link_addr
link_ntoa
- elementary address specification routines for link level access
SYNOPSIS
Fd #include <sys/types.h>
Fd #include <sys/socket.h>
Fd #include <net/if_dl.h>
Ft void
Fn link_addr const char *addr struct sockaddr_dl *sdl
Ft char *
Fn link_ntoa const struct sockaddr_dl *sdl
DESCRIPTION
The routine
Fn link_addr
interprets character strings representing
link-level addresses, returning binary information suitable
for use in system calls.
The routine
Fn link_ntoa
takes
a link-level
address and returns an
ASCII
string representing some of the information present,
including the link level address itself, and the interface name
or number, if present.
This facility is experimental and is
still subject to change.
For
Fn link_addr ,
the string
Fa addr
may contain
an optional network interface identifier of the form
``name unit-number''
suitable for the first argument to
ifconfig(4),
followed in all cases by a colon and
an interface address in the form of
groups of hexadecimal digits
separated by periods.
Each group represents a byte of address;
address bytes are filled left to right from
low order bytes through high order bytes.
Thus
le0:8.0.9.13.d.30
represents an ethernet address
to be transmitted on the first Lance ethernet interface.
RETURN VALUES
Fn link_ntoa
always returns a null terminated string.
Fn link_addr
has no return value.
(See
Sx BUGS . )
SEE ALSO
iso(4),
HISTORY
The
Fn link_addr
and
Fn link_ntoa
functions appeared in
BSD 4.3 Reno
BUGS
The returned values for link_ntoa
reside in a static memory area.
The function
Fn link_addr
should diagnose improperly formed input, and there should be an unambiguous
way to recognize this.
If the
sdl_len
field of the link socket address
Fa sdl
is 0,
Fn link_ntoa
will not insert a colon before the interface address bytes.
If this translated address is given to
Fn link_addr
without inserting an initial colon,
the latter will not interpret it correctly.
Index
- NAME
-
- SYNOPSIS
-
- DESCRIPTION
-
- RETURN VALUES
-
- SEE ALSO
-
- HISTORY
-
- BUGS
-
This document was created by
man2html,
using the manual pages.
Time: 19:41:59 GMT, December 25, 2022